﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/UserCenter.Master" Inherits="System.Web.Mvc.ViewPage<InfoVModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	<%:SiteResource.Title() %>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ScriptContent" runat="server">
    <link type="text/css" rel="Stylesheet" href="/Content/Css/validator.css" />
    <script type="text/javascript" src="/Scripts/jquery-1.4.1.min.js"></script>
    <script type="text/javascript" src="/Scripts/formValidator.js" charset="GB2312"></script>
    <script type="text/javascript" src="/Scripts/library.js" charset="GB2312"></script>
    <script type="text/javascript" src="/Scripts/plug.js" charset="GB2312"></script>
    <script type="text/javascript">
        var control = new plug.Control();
        $(function () {
            $.formValidator.initConfig({formID: "form1",onSuccess: function (meg) {return true;},onError: function (msg) { return false; }});
            $("input[name='NickName']").formValidator({ tipID: 'nickNameTip', onShow: ' ', onFocus: '请输入不超过20个字符', onError: "您的输入有误，请输入1-20个字符" }).inputValidator({ min: 1, max: 20, onError: '您的输入有误，请输入1-20个字符' }).regexValidator({ regExp: "^[^<>]+$", onError: "请勿包含特殊字符" });
            $("input[name='RealName']").formValidator({ tipID: 'RealNameTip', onShow: ' ', onFocus: '正确的真实姓名有利于您在职位角逐中获胜', onError: "您的输入有误" }).regexValidator({ regExp: '^.{1,20}$', onError: "您的输入有误，请输入1-20个字符" }).regexValidator({ regExp: "^[^<>]+$", onError: "请勿包含特殊字符" });
            $("input[name='Phone']").formValidator({ tipID: 'PhoneTip', onShow: ' ', onFocus: '正确的联系电话能使您的求职更加方便快捷', onError: "您的输入有误，请输入1-20个字符" }).regexValidator({ regExp: '^\\w{1,20}$', onError: '您的输入有误，请输入1-20个字符' }).regexValidator({ regExp: "^[^<>]+$", onError: "请勿包含特殊字符" });
            $('#form1').submit(function () {
                if (!$.formValidator.pageIsValid('1')) {
                    return;
                }
                var popframe = new plug.PopFrame();
                popframe.OpenFrame('pop', 'clo', function () {
                    $.ajax({
                        url: '/UserCenter/Info',
                        type: 'post',
                        cache: false,
                        data: {
                            NickName: $('input[name="NickName"]').val(),
                            RealName: $('input[name="RealName"]').val(),
                            Sex: $('input[name="Sex"]:checked').val(),
                            Location: $('select[name="Location"]').val(),
                            Phone: $('input[name="Phone"]').val(),
                            Collage: $('select[name="Collage"]').val()
                        },
                        beforeSend: function () {
                            $('#loadingmsgbox').text('保存中，请稍后...');
                        },
                        success: function (result) {
                            if (result == '1') {
                                $('#loadingmsgbox').text('保存成功');
                                window.setTimeout(function () {
                                    $('#clo').trigger('click');
                                }, 1200);
                            }
                            else {
                                $('#loadingmsgbox').text('操作失败，请稍后重试');
                                window.setTimeout(function () {
                                    $('#clo').trigger('click');
                                }, 1200);
                            }
                        }
                    });
                });
                return false;
            });
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder" runat="server">

<div class="usercenter-main">
    <input type="hidden" id="clo" />
    <div class="usercenter-main-topbg">
    </div>
    <div class="usercenter-main-content">
        <div class="usercenter-main-content-title">
            <div class="usercenter-main-content-title-left">
                个人资料管理</div>
        </div>
        <div class="usercenter-notes">
            完善您的个人信息，有助于在兼职竞争中拥有更佳的优势，请认真填写您的真实信息！</div>
        <div class="usercenter-tab">
            <div class="usercenter-tab-item">
                <a href="/UserCenter/Info" class="current">基本信息</a></div>
            <div class="usercenter-tab-item">
                <a href="/UserCenter/Individuation">头像</a></div>
        </div>
        <form id="form1" action="/UserCenter/Security" method="post">
        <div class="usercenter-main-content">
            <div class="textboxs">
                <div class="textboxs-label">
                    昵称：</div>
                <div class="textboxs-box">
                    <input type="text" name="NickName" value="<%:Model.NickName %>" id="txtnickName"
                        class="textboxs-ipt" /></div>
                <div class="textboxs-message" id="nickNameTip">
                    输入提示</div>
            </div>
            <div class="textboxs">
                <div class="textboxs-label">
                    真实姓名：</div>
                <div class="textboxs-box">
                    <input type="text" name="RealName" value="<%:Model.RealName %>" id="txtRealName" class="textboxs-ipt" /></div>
                <div class="textboxs-message" id="RealNameTip">
                    输入提示</div>
            </div>
            <div class="textboxs">
                <div class="textboxs-label">
                    性别：</div>
                <div class="textboxs-box">
                    <input type="radio" name="Sex" value="0" class="radio1" id="radio1" <%if(Model.Sex=="0"){ %>checked="checked"<%} %> />
                    <label for="radio1">
                        女</label>
                    <input type="radio" name="Sex" value="1" class="radio2" id="radio2" <%if(Model.Sex=="1"){ %>checked="checked"<%} %> />
                    <label for="radio2">
                        男</label>
                </div>
            </div>
            <div class="textboxs">
                <div class="textboxs-label">
                    所在区域：</div>
                <div class="textboxs-box">
                    <select name="Location" id="sltLocation" class="textboxs-select">
                    </select>
                    <script type="text/javascript">
                        control.BuildSelect({ element: 'sltLocation', bindtype: 'name', nobind: [0] }, 'WorkArea');
                        $('#sltLocation').val('<%:Model.Location %>');
                    </script>

                    </div>
                <div class="textboxs-message"></div>
            </div>
            <div class="textboxs">
                <div class="textboxs-label">
                    就读（毕业于）于：</div>
                <div class="textboxs-box">
                    <select name="Collage" id="sltCollage" class="textboxs-select">
                    </select>
                    <script type="text/javascript">
                        control.BuildSelect({ element: 'sltCollage', nobind: [0] }, 'Collage');
                        $('#sltCollage').val('<%:(int)Model.Collage %>');
                    </script>
                    </div>
                <div class="textboxs-message"></div>
            </div>
            <div class="textboxs">
                <div class="textboxs-label">
                    联系电话：</div>
                <div class="textboxs-box">
                    <input type="text" name="Phone" id="Phone" value="<%:Model.Phone %>" class="textboxs-ipt" /></div>
                <div class="textboxs-message" id="PhoneTip">
                    输入提示</div>
            </div>
            <div class="textboxs">
                <div class="textboxs-label">
                </div>
                <div class="textboxs-box">
                    <input type="image" id="btnSubmit" src="/Content/images/usercenter-save.png" />
                </div>
            </div>
        </div>
        </form>
    </div>
    <div class="usercenter-main-bottombg">
    </div>
</div>
<div id="pop" style="display:none;width:350px;height:100px;">
    <div id="loadingmsgbox">
    保存中，请稍后......
    </div>
</div>
</asp:Content>
